home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / ScreenSavers / BackSpaceViews / StarShipView.BackModule / README < prev    next >
Encoding:
Text File  |  1995-06-12  |  5.6 KB  |  128 lines

  1.                         StarShipView BackSpace Module 
  2.                         (For NeXTstep 3.0 or higher)
  3.  
  4. 1. Compiling:
  5.  
  6.     I wanted a module that could be completely built with PB. Double click
  7.     the PB.project file. In Project Builder, simply do a build with 
  8.     install in the Args field for  NextStep 3.0. If you are compiling under
  9.     3.1, select install from the target pull down menu and choose the 
  10.     appropriate cpu type from the options button.  It should install the
  11.     StarShipView.BackModule in the ~/Library/BackSpaceViews in your home
  12.     directory.If you want to include the Warp1 module, drag and drop the
  13.     Warp1.bproj subproject onto the subprojects suitcase in ProjectBuilder
  14.     and then do the compile.
  15.     
  16.     Important Notes:
  17.     
  18.     I am submitting a 3.0 and a 3.1 fat binary version. They
  19.     need to be run with the compatible version of BackSpace. I have been
  20.     told that doing the build install will not do the right things under
  21.     3.2 so when I know what the changes are, I will update.
  22.  
  23. 2 Internals:
  24.  
  25.     StarShip tries to simulate going through space in a starship.
  26.     
  27.     I had a idea to design a backspace module that would set
  28.     up an environment that others could write modules for and that
  29.     would be loaded in dynamically at run time. I include two separate
  30.     modules called Celestial and Warp1. Celestial is really the 
  31.     main module and Warp1 was a quick module to show how
  32.     other modules can be loaded and unloaded. I include Warp1 in the sources
  33.     but I don't include it  in the project.
  34.  
  35.     StarShipView really doesn't unload modules. At start time it builds
  36.     a list of all the bundle objects that are in the StarShipView.BackModule
  37.     folder(bundle). It instantiates all the classes that it finds up front.
  38.     I do provide a message to the freeResources method that is to be used
  39.     to get rid of memory gobblers like tiff images and sounds that are just
  40.     used for your module.
  41.     
  42.     There is a StarShipProtocol.h that includes the methods that must be
  43.     implemented. I really should test the modules to see if they conform
  44.     to the protocol but I haven't added that yet. The other "should be there",
  45.     is to have a separate button on the inspector panel that fires up a
  46.     separate info panel from the different modules. That way when your module
  47.     is active the user could get specific info about your module.
  48.     I do however provide a way to see on the inspector what module is currently
  49.     running. If anyone could tell me the easy way to do this with a nib file,
  50.     please let me know. I couldn't figure out how to free a loaded nib when
  51.     the next module is being loaded. The other way I thought of was to build 
  52.     the scrollView from scratch. I didn't like that either. Another thing
  53.     I thought of was that the slider labels in the inspector should be dynamic.
  54.     That way each module could label the sliders any way they wanted.
  55.     
  56.     The Module that you write will be sent the outlet for the stars so that
  57.     your module has control over starting and stopping them. You even have
  58.     control over turning them off altogether. See the HideStars method
  59.     in NewSpaceView. 
  60.     
  61.     The border around the viewscreen actually moves 9 pixels back and forth to
  62.     prevent screen burn in.
  63.     
  64.     
  65.     I have defined variables to allow you to custom tailor the
  66.     program. I've included them here.
  67.     
  68. NewSpaceView.m
  69.     
  70.     SCREENMOVE 1000  how often the screen border resizes
  71.     LIGHTMOVE 10     how often the lights below the viewscreen move
  72.     
  73.     
  74. Celestial.m
  75.     MAXMULTBODY 10   maximum mutiple objects - randomly generated up to
  76.     
  77. TiffManager.m
  78.     
  79.     MAXIMAGESIZE 150  maximum size the scaled images will be
  80.     SIZEINC  2          each animation frame is incremented by this amount
  81.                       in pixels - starting at 1 pixel 
  82.                       The smaller, the more images are built into memory
  83.                       but also the smoother the animation
  84.                           
  85. CelestialCommon.h
  86.     
  87.     MAXANIMATIONS 4      maximum number of animations to be built for each
  88.                       cycle - on larger memory machines you can up this
  89.                                 
  90.     
  91. 3:    The Celestial Module
  92.  
  93.     When the Celestial module is activated it starts building tiff images
  94.     in memory(tiffManager object) and adds them to a list that is put in a 
  95.     storage object. The Celestial object acts as the controller and then
  96.     takes the info in the storage object and creates and frees body objects
  97.     as they fly through space. To do mutiple objects, it just creates more
  98.     of them. The tricky part is for each body to set an avoidance rectangle
  99.     in a storage object. That storage object is passed off to the stars
  100.     object(NewSpaceView) who avoids drawing or erasing any stars there.
  101.     
  102. 4:    The Warp1 Module
  103.  
  104.     I wrote this module very quickly without too much thought as to how
  105.     good it looked. It really only serves as a second module to demonstrate
  106.     how the modules can be switched between.    
  107.  
  108. 5:  Thoughts
  109.     
  110.     I strip out all alpha from the tiff images coming in. This makes everything
  111.     go faster. It's ok to have alpha in your own tiff images cause I composite
  112.     to a black background. I did discover a way to have the starShipView
  113.     get running faster but it involved generating the animations to a
  114.     single tiff image ahead of time. Since I use lists of tiff images and
  115.     don't internally build a single tiff image (which could be done), it would
  116.     have taken a bit more work to build that functionality into it. Also
  117.     I didn't like the fact you would have all these huge files sitting around
  118.     just to launch faster. Currently they would range from .5 meg to 1.2 meg
  119.     each depending the the scheme to put all the images into one tiff image.
  120.     Besides, the idea of a screen saver isn't really to sit and watch it,
  121.     or is it? Anyways, I do hope someone will write some others to go along
  122.     with these. If you have any questions, feel free to contact me. Enjoy!
  123.     
  124.     R.S. Brown
  125.     rsbrown@nosc.mil
  126.  
  127.  
  128.